package com.mycar2w.cloud.entity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.sql.Timestamp;

/**
 * created time 2017/4/1
 *
 * @author ljc
 * @version V1.0
 */
@Entity
@Table(name = "t_user", schema = "mycar2wnew", catalog = "")
public class TUser {
    private Long id;
    private String email;
    private String password;
    private Integer age;
    private Long genderId;
    private Long addressId;
    private String nickname;
    private String identification;
    private String protrait;
    private Timestamp createTime;
    private Timestamp lastModifiedTime;
    private String phone;
    private Integer isAble;
    private String occupation;
    private String role;

    @Id
    @Column(name = "id")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "email", nullable = false, length = 50)
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Basic
    @Column(name = "password", nullable = false, length = 50)
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Basic
    @Column(name = "age", nullable = true)
    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Basic
    @Column(name = "gender_id", nullable = true)
    public Long getGenderId() {
        return genderId;
    }

    public void setGenderId(Long genderId) {
        this.genderId = genderId;
    }

    @Basic
    @Column(name = "address_id", nullable = true)
    public Long getAddressId() {
        return addressId;
    }

    public void setAddressId(Long addressId) {
        this.addressId = addressId;
    }

    @Basic
    @Column(name = "nickname", nullable = true, length = 50)
    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    @Basic
    @Column(name = "identification", nullable = true, length = 50)
    public String getIdentification() {
        return identification;
    }

    public void setIdentification(String identification) {
        this.identification = identification;
    }

    @Basic
    @Column(name = "protrait", nullable = true, length = 50)
    public String getProtrait() {
        return protrait;
    }

    public void setProtrait(String protrait) {
        this.protrait = protrait;
    }

    @Basic
    @Column(name = "create_time", nullable = false)
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "last_modified_time", nullable = false)
    public Timestamp getLastModifiedTime() {
        return lastModifiedTime;
    }

    public void setLastModifiedTime(Timestamp lastModifiedTime) {
        this.lastModifiedTime = lastModifiedTime;
    }

    @Basic
    @Column(name = "phone", nullable = true, length = 255)
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Basic
    @Column(name = "is_able", nullable = true)
    public Integer getIsAble() {
        return isAble;
    }

    public void setIsAble(Integer isAble) {
        this.isAble = isAble;
    }

    @Basic
    @Column(name = "occupation", nullable = true, length = 255)
    public String getOccupation() {
        return occupation;
    }

    public void setOccupation(String occupation) {
        this.occupation = occupation;
    }

    @Basic
    @Column(name = "role", nullable = true, length = 255)
    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TUser tUser = (TUser) o;

        if (id != null ? !id.equals(tUser.id) : tUser.id != null) return false;
        if (email != null ? !email.equals(tUser.email) : tUser.email != null) return false;
        if (password != null ? !password.equals(tUser.password) : tUser.password != null) return false;
        if (age != null ? !age.equals(tUser.age) : tUser.age != null) return false;
        if (genderId != null ? !genderId.equals(tUser.genderId) : tUser.genderId != null) return false;
        if (addressId != null ? !addressId.equals(tUser.addressId) : tUser.addressId != null) return false;
        if (nickname != null ? !nickname.equals(tUser.nickname) : tUser.nickname != null) return false;
        if (identification != null ? !identification.equals(tUser.identification) : tUser.identification != null)
            return false;
        if (protrait != null ? !protrait.equals(tUser.protrait) : tUser.protrait != null) return false;
        if (createTime != null ? !createTime.equals(tUser.createTime) : tUser.createTime != null) return false;
        if (lastModifiedTime != null ? !lastModifiedTime.equals(tUser.lastModifiedTime) : tUser.lastModifiedTime != null)
            return false;
        if (phone != null ? !phone.equals(tUser.phone) : tUser.phone != null) return false;
        if (isAble != null ? !isAble.equals(tUser.isAble) : tUser.isAble != null) return false;
        if (occupation != null ? !occupation.equals(tUser.occupation) : tUser.occupation != null) return false;
        if (role != null ? !role.equals(tUser.role) : tUser.role != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (email != null ? email.hashCode() : 0);
        result = 31 * result + (password != null ? password.hashCode() : 0);
        result = 31 * result + (age != null ? age.hashCode() : 0);
        result = 31 * result + (genderId != null ? genderId.hashCode() : 0);
        result = 31 * result + (addressId != null ? addressId.hashCode() : 0);
        result = 31 * result + (nickname != null ? nickname.hashCode() : 0);
        result = 31 * result + (identification != null ? identification.hashCode() : 0);
        result = 31 * result + (protrait != null ? protrait.hashCode() : 0);
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        result = 31 * result + (lastModifiedTime != null ? lastModifiedTime.hashCode() : 0);
        result = 31 * result + (phone != null ? phone.hashCode() : 0);
        result = 31 * result + (isAble != null ? isAble.hashCode() : 0);
        result = 31 * result + (occupation != null ? occupation.hashCode() : 0);
        result = 31 * result + (role != null ? role.hashCode() : 0);
        return result;
    }
}
